package org.budo.lock.distributed.api.annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * @author limingwei2
 */
@Target(ElementType.METHOD)
@Retention(value = RetentionPolicy.RUNTIME)
public @interface DistributedLock {
    public Action action() default Action.ERROR;

    /**
     * 等待时间
     */
    public int waits() default 1000;

    /**
     * 尝试次数
     */
    public int trys() default 1;

    public enum Action {
        ERROR, FAIL
    }
}